/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.config.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author cmontes
 */
@Embeddable
public class BusinessHourPK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -4124525080160361154L;
	@Basic(optional = false)
    @Column(name = "ID_CALENDAR")
    private Long idCalendar;
    @Basic(optional = false)
    @Column(name = "ID_BUSINESS_DAY")
    private Long idBusinessDay;
    @Basic(optional = false)
    @Column(name = "START_HOUR")
    private String startHour;

    public BusinessHourPK() {
    }

    public BusinessHourPK(Long idCalendar, Long idBusinessDay, String startHour) {
        this.idCalendar = idCalendar;
        this.idBusinessDay = idBusinessDay;
        this.startHour = startHour;
    }

    public Long getIdCalendar() {
        return idCalendar;
    }

    public void setIdCalendar(Long idCalendar) {
        this.idCalendar = idCalendar;
    }

    public Long getIdBusinessDay() {
        return idBusinessDay;
    }

    public void setIdBusinessDay(Long idBusinessDay) {
        this.idBusinessDay = idBusinessDay;
    }

    public String getStartHour() {
        return startHour;
    }

    public void setStartHour(String startHour) {
        this.startHour = startHour;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCalendar != null ? idCalendar.hashCode() : 0);
        hash += (idBusinessDay != null ? idBusinessDay.hashCode() : 0);
        hash += (startHour != null ? startHour.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof BusinessHourPK)) {
            return false;
        }
        BusinessHourPK other = (BusinessHourPK) object;
        if ((this.idCalendar == null && other.idCalendar != null) || (this.idCalendar != null && !this.idCalendar.equals(other.idCalendar))) {
            return false;
        }
        if ((this.idBusinessDay == null && other.idBusinessDay != null) || (this.idBusinessDay != null && !this.idBusinessDay.equals(other.idBusinessDay))) {
            return false;
        }
        if ((this.startHour == null && other.startHour != null) || (this.startHour != null && !this.startHour.equals(other.startHour))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.BusinessHourPK[ idCalendar=" + idCalendar + ", idBusinessDay=" + idBusinessDay + ", startHour=" + startHour + " ]";
    }
    
}
